package com.enki.cigarettes.enums;

/**
 * @author WCS.Wang
 * @version V1.0
 * @Package com.enki.cigarettes.enums
 * @Name e-cigarettes-shop-api-module
 * @Description: TODO 用户枚举
 * @date 2019-07-30
 */
public class UserEnums {

    public enum Gender {
        SECRECY("保密", 0), MALE("男", 1), FEMALE("女", 2);

        private String name;
        private int gender;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getGender() {
            return gender;
        }

        public void setGender(int gender) {
            this.gender = gender;
        }

        Gender(String name, int gender) {
            this.name = name;
            this.gender = gender;
        }

        public static String getName(int gender) {
            for (Gender g : Gender.values()) {
                if (g.getGender() == gender) {
                    return g.getName();
                }

            }
            return "";
        }
    }

    /**
     * 用户来源
     */
    public enum UserSource {
        CHINESE("中文", 0), ENGLISH("英文", 1);

        private String name;
        private int source;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getSource() {
            return source;
        }

        public void setSource(int source) {
            this.source = source;
        }

        UserSource(String name, int source) {
            this.name = name;
            this.source = source;
        }

        public static String getName(int source) {
            for (UserSource us: UserSource.values()) {
                if(us.getSource() == source) {
                    return us.getName();
                }
            }
            return "";
        }
    }

}
